-- @owner: cr13
-- @date: 2025/3/27
-- @testpoint:删除函数添加cascade选项，部分合理报错
--step1: 创建 PostgreSQL 风格的自定义函数;expect:成功
drop function if exists add_numbers_pg(a int,b int);
CREATE FUNCTION add_numbers_pg(a INTEGER, b INTEGER)
RETURNS INTEGER AS $$
BEGIN
RETURN a + b;
END;
$$ LANGUAGE plpgsql;
/
--step2: 创建视图;expect:成功
drop view if exists v_ddl0043;
create view v_ddl0043 as select add_numbers_pg(1,2);
--step3: 查询视图;expect:成功
select * from v_ddl0043;
--step4: 删除函数;expect:成功
drop function add_numbers_pg(a INTEGER, b INTEGER) cascade;
--step5: 查询视图;expect:报错
select * from v_ddl0043;
